//
//  JBWPayViewController.m
//  JBWDSK
//
//  Created by 崔志伟 on 2018/7/30.
//  Copyright © 2018年 崔志伟. All rights reserved.
//

#import "JBWRechargeCenterViewController.h"
#import "JBWPayDetailController.h"

@interface JBWRechargeCenterViewController ()
@property (nonatomic,strong) UIButton *payBtn ;

@end

@implementation JBWRechargeCenterViewController

- (void)setUpProductInfoView {
    UIView *productInfoView = [[UIView alloc]initWithFrame:CGRectMake(0, 48, self.bgContentView.frame.size.width, 110)];
    [self.bgContentView addSubview:productInfoView];
    UILabel *orderTypeLabel = [[UILabel alloc]initWithFrame:CGRectMake(15, 20, productInfoView.frame.size.width-30, 30)];
    orderTypeLabel.textColor = [UIColor whiteColor];
    orderTypeLabel.font = [UIFont systemFontOfSize:15];
    orderTypeLabel.text = @"订单类型        产品名称";
    [productInfoView addSubview:orderTypeLabel];
    UILabel *orderAmountLabel = [[UILabel alloc]initWithFrame:CGRectMake(15, 60, productInfoView.frame.size.width-30, 30)];
    orderAmountLabel.textColor = [UIColor whiteColor];
    orderAmountLabel.font = [UIFont systemFontOfSize:15];
    orderAmountLabel.text = @"订单金额        ￥11";
    [productInfoView addSubview:orderAmountLabel];
    UIView *lineView = [[UIView alloc]initWithFrame:CGRectMake(15, 109, productInfoView.frame.size.width-30, 1)];
    lineView.backgroundColor = [UIColor grayColor];
    [productInfoView addSubview:lineView];
}

- (void)setUpPayTypeView {
    UIView *payTypeView = [[UIView alloc]initWithFrame:CGRectMake(0, 48+110, self.bgContentView.frame.size.width, 100)];
    [self.bgContentView addSubview:payTypeView];
    
    UILabel *payTypeLabel = [[UILabel alloc]initWithFrame:CGRectMake(15, 10,80, 30)];
    payTypeLabel.textColor = [UIColor whiteColor];
    payTypeLabel.font = [UIFont systemFontOfSize:15];
    payTypeLabel.text = @"支付方式";
    [payTypeView addSubview:payTypeLabel];
    
    
    
    
    
    self.payBtn = [[UIButton alloc]initWithFrame:CGRectMake(15, 360-40-48, self.bgContentView.frame.size.width-30, 40)];
    self.payBtn.backgroundColor = [UIColor orangeColor];
    [self.payBtn setTitle:@"立即支付" forState:UIControlStateNormal];
    [self.payBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
    self.payBtn.titleLabel.font = [UIFont systemFontOfSize:15];
    self.payBtn.layer.cornerRadius = 5;
    self.payBtn.layer.masksToBounds = YES;
    [self.payBtn addTarget:self action:@selector(payBtnAction) forControlEvents:UIControlEventTouchUpInside];
    [self.bgContentView addSubview:self.payBtn];
    
    //已登录账号
    UIView * loginAccountView = [[UIView alloc]initWithFrame:CGRectMake(0, CGRectGetMaxY(self.payBtn.frame), MAIN_BG_VIEW_WIDTH, 360-CGRectGetMaxY(self.payBtn.frame))];
    [self.bgContentView addSubview:loginAccountView];
    
    UILabel * loginAccountLabel = [[UILabel alloc]initWithFrame:CGRectMake(15, 0, 155, CGRectGetHeight(loginAccountView.frame))];
    loginAccountLabel.textColor = [UIColor grayColor];
    loginAccountLabel.font = [UIFont systemFontOfSize:14];
    loginAccountLabel.text = @"已登录：18688497608";
    [loginAccountView addSubview:loginAccountLabel];
    
    //支付详情
    UIButton *payInfoBtn = [[UIButton alloc]initWithFrame:CGRectMake(MAIN_BG_VIEW_WIDTH-80, 0, 60, CGRectGetHeight(loginAccountView.frame))];
    [payInfoBtn setTitle:@"人工汇款" forState:UIControlStateNormal];
    [payInfoBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
    payInfoBtn.titleLabel.font = [UIFont systemFontOfSize:14];
    [payInfoBtn addTarget:self action:@selector(payInfoBtnAction) forControlEvents:UIControlEventTouchUpInside];
    [loginAccountView addSubview:payInfoBtn];
}

- (void)viewDidLoad {
    [super viewDidLoad];
    [self setUpSubView];
    
}

- (void)setUpSubView{
    self.bgContentViewHight = 360.0f;
    self.backTitle = @"充值中心";
    self.navView.isHideRightBtn = NO;
    [self setUpProductInfoView];
    [self setUpPayTypeView];
    
}
- (void)payBtnAction{
    
    
    
    
}

- (void)payInfoBtnAction{
    
    [self removeBgContentViewAllSubView];
    JBWPayDetailController *payDetailVC = [[JBWPayDetailController alloc]init];
    payDetailVC.dismissBlock = ^{
        [self setUpSubView];
    };
    [self presentViewController:payDetailVC animated:NO completion:nil];
    
    
}


@end
